package com.lbx.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author 吕兵星
 * @date 2020/10/22 20:41
 */
@Controller
public class HelloController {
    @GetMapping("/hello")
    public String hello(Model model){
        model.addAttribute("msg","<h1>MSG : Hello springMvc</h1>");
        return "hello";
    }
    @PostMapping("/h1")
    public String hello1(String name,Model model){
        System.out.println(name);
        model.addAttribute("name",name);
        return "hello";
    }
}
